<%= form_for(@treatment, url: 
if action_name == "new"
	appointment_treatments_path
else
	appointment_treatment_path
end
) do |f| %>
  <% if @treatment.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@treatment.errors.count, "error") %> prohibited this treatment from being saved:</h2>

      <ul>
      <% @treatment.errors.full_messages.each do |message| %>
        <li><%= message %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= f.label :label %><br>
    <%= f.text_field :label %>
  </div>
  <div class="field">
    <%= f.label :detail %><br>
    <%= f.text_field :detail %>
  </div>
  <div class="field">
    <%= f.label :treatment_group_id %><br>
    <%= collection_select(:treatment, :treatment_group_id, TreatmentGroup.all, :id, :label, prompt: true) %>
  </div>
  <div class="field">
    <%= f.label :fee %><br>
    <%= f.text_field :fee %>
  </div>
  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>
